package com.neuedu.his.controller;

import com.neuedu.his.po.Constanttype;
import com.neuedu.his.service.ConstanttypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/constanttype")
public class ConstantTypeController {

    @Autowired
    ConstanttypeService service;

    @RequestMapping("/add")
    public Boolean add(@RequestBody  Constanttype type){
        return service.save(type);
    }

    @RequestMapping("/list")
    public List<Constanttype> list(){
        return service.list();
    }

    @RequestMapping("/update")
    public Boolean update(@RequestBody Constanttype constanttype) {
        return service.updateConstanttype(constanttype);
    }

    @RequestMapping("/delete/{id}")
    public Boolean delete(@PathVariable Integer id) {
        return service.deleteConstanttype(id);
    }
}